JVTwitter =  Fx.Elements.extend({
	options:{},	
    initialize: function(){    	
    	$each(arguments, function(argument, i){	        		
			switch($type(argument)){
				case 'object': options = argument; break;				
				default: container = $(argument);						
			}
		});      
    	this.setOptions(options);     	
    	this.getTwitter();       
    },    
    getTwitter: function(){               
        urlAjax = this.options.urlAjax+'?moduleId='+this.options.moduleId+'&isMerge='+this.options.isMerge;
    	var request = new Json.Remote(urlAjax,{            
        }).send();    	   
    	request.addEvent('onComplete', function(jsonObj){ 		
			var divWrap = $(this.options.wrapTwitter);		
			divWrap.removeClass('twitter-ajax-loading');
			if(jsonObj.twitter){
				divWrap.innerHTML = jsonObj.twitter;
				if(this.options.isAccord == 1){
				 var twitterAccordion = new JVAccordion('div.jv_header_wrapper','div.twitter_content',{
	                 opacity: false,
	                 alwaysHide:true,
	                 firstItem:0,                                                    
	                 onActive:function(toggler,element){ 
	                     toggler.setStyle('opacity','1');                               
	                 },
	                 onBackground:function(toggler,element){
	                     toggler.setStyle('opacity','0.5');
	                 }                            
	             },
	             $(this.options.statusId));
				}				
				$('jv_twitter_follow'+this.options.moduleId).setStyle('display','none');
		}
       }.bind(this));       
    }   
});
Fx.JVTwitter = JVTwitter;